import { Component } from 'react';
import '../../css/comment.css'
import Input from '../../components/Comments/Input'
import List from '../../components/Comments/List'
class Components extends Component {
    constructor(props) {
        super(props);
        this.state = {
            list: [
                {
                    title: '评论人：图图',
                    context: '评论内容：很好，很不错'
                }
            ]
        }
    }


    updateList = (val) => {
        const list = [...this.state.list]
        list.push(val)
        this.setState({
            list
        })
    }
    dels = () => {
        const list = [...this.state.list]
        this.setState({
            list
        })
    }
    render() {
        return (
            <>
                <div className='box'>
                    <Input updateList={this.updateList} />
                    <List list={this.state.list} dels={this.dels} />
                </div>
            </>
        );
    }
}

export default Components;